<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<!--显示过滤/排序后的结果-->
<div id="app19">
    <li v-for="n in evenNumbers">{{ n }}</li>
</div>

<script type="text/javascript">
    var vm = new Vue({
        el: '#app19',
        data: {
            numbers: [1, 2, 3, 4, 5]
        },
        computed: {
            evenNumbers: function () {
                return this.numbers.filter(function (number) {
                    return number % 2 === 0
                })
            }
        }
    })
</script>
</body>
</html>